﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="Search.aspx.cs" Inherits="HiTeachers.Web.Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script src="//www.google.com/jsapi" type="text/javascript"></script>

    <script type="text/javascript">
        google.load('search', '1', { language: 'vi', style: google.loader.themes.MINIMALIST });
        google.setOnLoadCallback(function() {
            var customSearchControl = new google.search.CustomSearchControl('002170810936989554165:9orykflcz20');
            customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
            var options = new google.search.DrawOptions();
            options.setSearchFormRoot('cse-search-form');
            customSearchControl.draw('cse', options);
        }, true);
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMainMenu" runat="server">
    <hiteacher:MainMenu ID="mnuMain" runat="server" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphSearch" runat="server">
    <div id="cse-search-form" style="width: 100%;">
        Loading</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMain" runat="server">
    <div id="cse" style="width: 100%;">
    </div>

    <script type="text/javascript" language="javascript">
        setTimeout("SetValue();", 1000);

        SetValue = function() {
            var keyword = $.getUrlVar('search');
            if (typeof (keyword) != 'undefined') {
                keyword = decodeURIComponent(keyword.replace(/\+/g, " "))//$.URLDecode(keyword);
                keyword = keyword.replaceAll('+', ' ');
                $('input[class=" gsc-input"]').val(keyword);
                $('input[class=" gsc-input"]').focus();
                $('form[class="gsc-search-box"]').submit();
            }
        } 
    </script>

</asp:Content>
